<template>
  <star-table
    :ref="ref"
    :config="config"
    :loading="loading"
    :data="data"
    :columns="columns"
    :additionalAction="additionalAction"
    :pageSizeOpts="pageSizeOpts"
    :pageNavigation="pageNavigation"
    :queryFormItem="queryFormItem"
    :collapseFormItem="collapseFormItem"
    :btnShowFun="btnShowFun"
    :rowbgc="rowbgc"
    :tableStyle="{ overflow: 'hidden !important' }"
    @loadPage="loadPage"
    @handleEdit="handleEdit"
    @handleDelete="handleDelete"
    @handleDetail="handleDetail"
    @handleClick="handleClick"
    @handleDbClick="handleDbClick"
    @handleCreate="handleCreate"
    @handleDeleteMultiple="handleDeleteMultiple"
    @handleSearch="handleSearch"
    @handleReset="handleReset"
  ></star-table>
</template>

<script>
const ref = "orderInfoTable";
export default {
  name: ref,
  components: {},
  inject: ["anc"],
  data() {
    return {
      ref,
      loading: false,
      pageNavigation: {
        total: 0,
        pageSize: 10,
        pageNumber: 1,
      },
      jobOptions: [],
    };
  },
  props: {
    data: {
      default: () => {
        return [];
      },
    },
  },
  watch: {},
  computed: {
    config() {
      return {
        search: false,
        addButton: false,
        batchDeleteButton: false,
        downloadIcon: false,
        uploadIcon: false,
        uploadUrl: "/",
        tableSizeIcon: false,
        fullscreenIcon: false,
        refreshIcon: false,
        columnSettingIcon: false,
        checkColumnDisabled: true,
        action: false, // 操作
        additionalAction: false, // 新增自定义
        navigation:false,
      };
    },
    columns() {
      return [
        {
          key: "orderNo",
          title: "订单号",
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "productId",
          title: "产物规格ID",
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h(
              "div",
              {},
              this._$getOptionValue(this.anc.productOptions, params.row.productId)
            );
          },
        },
        {
          key: "batchNo",
          title: "订单批次号",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "status",
          title: "状态",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "routingId",
          title: "工艺路径",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "statusD",
          title: "代加工标识",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "orderFrom",
          title: "订单标识",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "weight",
          title: "重量(KG)",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "maxFSSS",
          title: "最大FSSS",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "minFSSS",
          title: "最小FSSS",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "maxCT",
          title: "最大CT",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "minCT",
          title: "最小CT",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "FSSS",
          title: "平均FSSS",
          minWidth: 100,
          align: "center",
          show: true,
        },

        {
          key: "deliveryDate",
          title: "交货日期",
          minWidth: 100,
          align: "center",
          show: true,
        },

        {
          key: "supplyStandard",
          title: "供货标准",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "packingRequirement",
          title: "包装要求",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "customerInformation",
          title: "客户信息",
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: "备注",
          minWidth: 100,
          align: "center",
          show: false,
        },
      ];
    },
    additionalAction() {
      return {
        key: "additionalAction",
        title: "附加操作",
        slot: "additionalAction",
        width: 200,
        fixed: "right",
        align: "center",
        show: true,
        buttons: [],
      };
    },
    pageSizeOpts() {
      return [10, 30, 50, 100];
    },

    queryFormItem() {
      return [];
    },
    collapseFormItem() {
      return [];
    },
    btnShowFun() {
      return function () {
        return true;
      };
    },
    rowbgc() {
      return "red";
    },
  },
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.$set(this.anc.vms, this.ref, this);
    });
  },
  methods: {
    loadPage(pageNavigation, filter) {},
    handleEdit(row, index) {},
    handleDelete(row, index) {},
    handleDetail(row, index) {
      this.anc.handleDetail(row);
    },
    handleClick(row, index) {},
    handleDbClick(row, index) {},
    handleDeleteMultiple(selection) {},
    handleSearch(filter) {},
    handleCreate() {},
    handleReset() {},
  },
};
</script>
<style scoped></style>
